<?php
/**
 * This class contain methods for code debug
 * @author Dmitry Seliveystrov silver89dima@gmail.com
 */
class Common_DevelopDebug
{
    /**
     * This method implements var_dump() function whith addition information.
     * @param type $data 
     * @static
     */
    static public function dump($data)
    {
        $arrDebug = debug_backtrace();
        echo $arrDebug[0]['file'] . ' -- ' . $arrDebug[0]['line'] . ' line';
        echo '<pre>';
        var_dump($data);
        echo '</pre>';
    }
    
    /**
     * This method implements var_dump function whith addition information.
     * Also this method at the end contain die() function
     * @param type $data 
     * @static
     */
    static public function dumpDie($data)
    {
        $arrDebug = debug_backtrace();
        echo $arrDebug[0]['file'] . ' -- ' . $arrDebug[0]['line'] . ' line';
        echo '<pre>';
        var_dump($data);
        echo '</pre>';
        die;
    }
    
    /**
     *
     * @param type $data 
     * @static
     */
    static public function printDie($data)
    {
        $arrDebug = debug_backtrace();
        echo $arrDebug[0]['file'] . ' -- ' . $arrDebug[0]['line'] . ' line';
        echo '<pre>';
        print_r($data);
        echo '</pre>';
        die;
    }
    
    /**
     *
     * @param type $data 
     * @static
     */
    static public function printR($data)
    {
        $arrDebug = debug_backtrace();
        echo $arrDebug[0]['file'] . ' -- ' . $arrDebug[0]['line'] . ' line';
        echo '<pre>';
        print_r($data);
        echo '</pre>';
    }
    
}
